package com.baizan.daka.ui.fragment

import androidx.fragment.app.Fragment
import com.baizan.base.BaseFragment
import com.baizan.daka.base.BasePresenter
import com.baizan.daka.util.FragmentStack
import com.dianzan.daka.R
import com.flyco.tablayout.listener.CustomTabEntity
import com.xinfang.louxun.base.adapter.BaseFragmentAdapter
import kotlinx.android.synthetic.main.frg_task_home.*
import java.util.*

class TaskFragment : BaseFragment<BasePresenter>() {
    private val mTitles = arrayOf("待完成", "待审核", "已完成")

    private val mTabTitleList = ArrayList<String>()
    private var mFragmentList = ArrayList<Fragment>()

    override fun initPresenter(): BasePresenter? = null

    override fun layoutId(): Int = R.layout.frg_task_home


    var adapter :BaseFragmentAdapter? = null

    override fun initData() {
        adapter = BaseFragmentAdapter(childFragmentManager, mFragmentList, mTabTitleList)
        mViewPager.setAdapter(adapter)
        initTab()
    }
    private fun initTab() {

        mFragmentList.add(TaskingFragment())
        mFragmentList.add(TaskCheckFragment())
        mFragmentList.add(TaskedFragment())


        adapter?.recreateItems(mFragmentList, mTitles)
        mTabLayout.setViewPager(mViewPager, mTitles)
    }

    override fun initView() {

    }

    override fun start() {

    }

}